home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
S-Sound and Music
/
(c)s3.d64
/
sound tut-2.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
15KB
|
397 lines
0 REM" P.J.PONZO*83*WATERLOO/ONTARIO
1000 [141]60000:[153][199](142):[153]"LOAD SOUND-2"
1001 [153]"ORTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTAN^"
1002 [153]"(null) MORE C4 SOUND WAIT (null)":MS$[178]"PONZOTUTOR"
1003 [153]"/TANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANEXPSTOP":[141]63100:MS$[178]" WELCOME!"
1004 [141]63100:[141]50000:[141]63000:[153]"LOADSTOP";
1010 [153]"LOADRECALLWAIT:SID=54272"
1020 M$[178]" SID:LO FREQUENCY":[141]11100
1030 M$[178]" SID+1:HI FREQUENCY":[141]11100
1040 M$[178]" SID+2:LO PULSE":[141]11100
1050 M$[178]"CMDCMDCMDCMDCMDCMDCMDCMDCMDON ORCMDCMDCMDCMDCMD / SID+3:HI PULSE":[141]11100
1060 M$[178]" SID+4:WAVEFORM":[141]11100
1070 M$[178]" SID+5:ATTACK/DECAY":[141]11100
1080 M$[178]" SID+6:SUSTAIN/RELEASE":[141]11100:[141]63000
1090 [153]"ONONONONON":[153]"ALL THIS FOR VOICE#1":[141]63000:XX[178]1:[153]"ONONONON"
1095 [129]I[178]1[164]5:[153]BL$:[130]
1100 [153]"THEN...VOICE #2WAIT..":M$[178]" SID+7:LO FREQUENCY":[141]11100
1110 M$[178]" SID+8:HI FREQUENCY":[141]11100
1120 M$[178]" SID+9:LO PULSE":[141]11100
1130 M$[178]"CMDCMDCMDCMDCMDCMDCMDCMDCMDON ORCMDCMDCMDCMDCMD / SID+10:HI PULSE":[141]11100
1140 M$[178]" SID+11:WAVEFORM":[141]11100
1150 M$[178]" SID+12:ATTACK/DECAY":[141]11100
1160 M$[178]" SID+13:SUSTAIN/RELEASE":[141]11100:[153]"THEN FOR VOICE #3WAIT.."
1170 M$[178]" SID+14:LO FREQUENCY":[141]11100
1180 M$[178]" SID+15:HI FREQUENCY":[141]11100
1190 M$[178]" SID+16:LO PULSE":[141]11100
1200 M$[178]"CMDCMDCMDCMDCMDCMDCMDCMDCMDON ORCMDCMDCMDCMDCMD / SID+17:HI PULSE":[141]11100
1210 M$[178]" SID+18:WAVEFORM":[141]11100
1220 M$[178]" SID+19:ATTACK/DECAY":[141]11100
1230 M$[178]" SID+20:SUSTAIN/RELEASE":[141]11100
1240 [153]"AND..":M$[178]" SID+24:VOLUME":[141]11100:[153]"":[141]63000
1250 [153]"LOADWHAT ABOUT REGISTERS SID+21TO SID+23?":
1260 [153]"WE POKE SID+24,VOLWAIT AND VOL<16.":[153]"IS SID+24 ONLY A NYBBLE?
1270 PRINT"WE'LL LOOK AT SID+21 TO SID+24.":GOSUB63000:MS$="LET'S LOOK"
1280 GOSUB63100:PRINT"[147]AFTER GIVING 3 VOICES AN ADSR[146] ENVELOPE"
1290 PRINT"AND A FREQUENCY[146] AND A WAVEFORM[146],"
1300 PRINT"THE 3 VOICES EACH HAVE A 'PERSONALITY'."
1310 PRINT"THE SOUND OF EACH IS DETERMINED"
1320 PRINT"BY IT'S FREQUENCY COMPOSITION WHICH"
1330 PRINT"YOU CONTROL USING THE ABOVE PARAMETERS."
1340 PRINT"AFTER THIS..BUT BEFORE COMBINING"
1350 PRINT"THE 3 VOICES..YOU MAY MODIFY THIS"
1360 PRINT"FREQUENCY COMPOSITION BY HAVING"
1370 PRINT"SOME OF THE VOICES"
1380 PRINT"PASS THROUGH A FILTER[146].":GOSUB63000:MS$="A FILTER?":GOSUB63100
1390 GOSUB63000:PRINT"[147]THE LOW PASS FILTER[146] WILL ATTENUATE"
1400 PRINT"ALL FREQUENCY COMPONENTS ABOVE A"
1410 PRINT"CERTAIN 'CUT OFF FREQUENCY'."
1420 PRINT"A HIGH PASS FILTER[146] WILL ATTENUATE"
1430 PRINT"FREQUENCIES BELOW A 'CUT OFF FREQUENCY'."
1440 PRINT"A BAND PASS FILTER[146] WILL ATTENUATE"
1450 PRINT"FREQUENCIES ON EITHER SIDE OF SOME"
1460 PRINT"'CUT OFF FREQUENCY'."
1470 PRINT"IF WE CHOOSE TO 'FILTER' ONE OF THE"
1480 PRINT"3 VOICES, WE MUST TELL SID[146]"
1490 PRINT"THE CUT OFF FREQUENCY[146].":MS$="POKE SID+":GOSUB63100:GOSUB63000
1500 PRINT"[147]SID+21 IS 3 BITS & SID+22 IS A BYTE!"
1510 PRINT"THAT MAKES 11 BITS HENCE 2^11=2048"
1520 PRINT"POSSIBLE 'CUTOFF' FREQUENCIES."
1530 PRINTSPC(10)N$(1)"[157][157][157][174] ":PRINTSPC(10)N$(2)"[157][157] SID+21"
1535 PRINTSPC(10)N$(3)"[157][157][157][189] "
1540 PRINTNN$(1):PRINTNN$(2)" SID+22":PRINTNN$(3)
1550 PRINT"WE CHOOSE CN=CUTOFF FREQ NUMBER,THEN:"
1560 PRINT"HI=INT(CN/8):LO=CN-8*HI "
1570 PRINT"POKE SID+21,LO:POKE SID+22,HI[146]"
1580 PRINT"THE RELATION BETWEEN THE 'NUMBER' CN[146]"
1590 PRINT"AND THE ACTUAL 'CUTOFF FREQUENCY'"
1600 PRINT"CUTOFF FREQ=30+5.8*CN HERTZ":GOSUB63000
1601 PRINT"[147]CUTOFF FREQ=30+5.8*CN HERTZ"
1602 PRINT"FOR CN=2047 (THE MAXIMUM) WE GET:"
1603 PRINT"CUTOFF FREQUENCY=30+5.8*2047=11902[146] HERTZ":GOSUB63000
1610 PRINT"[147]WE MUST ALSO TELL SID[146] WHETHER WE"
1620 PRINT"WANT LOW[146], BAND[146] OR HIGH[146] PASS:"
1630 M$=" SID+24 SID REGISTER":GOSUB11000:GOSUB63000
1640 LP$=""
1650 BP$=""
1660 HP$=""
1670 DN$=""
1680 PRINTDN$BL$DN$"LOW PASS BIT":FORI=1TO5:PRINTLP$"[214]":FORT=1TO50:NEXT
1690 PRINTLP$"[214][146]":FORT=1TO50:NEXT:NEXT:GOSUB63000
1700 PRINTDN$BL$DN$"BAND PASS BIT":FORI=1TO5:PRINTBP$"[214]":FORT=1TO50:NEXT
1710 PRINTBP$"[214][146]":FORT=1TO50:NEXT:NEXT:GOSUB63000
1720 PRINTDN$BL$DN$"HIGH PASS BIT":FORI=1TO5:PRINTHP$"[214]":FORT=1TO50:NEXT
1730 PRINTHP$"[214][146]":FORT=1TO50:NEXT:NEXT:GOSUB63000
1740 PRINTDN$BL$DN$"VOLUME CONTROL!":FORI=1TO5
1745 PRINTLP$"[214][214][214][214]":FORT=1TO50:NEXT
1750 PRINTLP$"[214][214][214][214]":FORT=1TO50:NEXT:NEXT:GOSUB63000
1760 PRINTDN$BL$DN$"..AND THIS BIT?":FORI=1TO5:PRINTHP$"[157][157]?":FORT=1TO50:NEXT
1770 PRINTHP$"[157][157]?[146]":FORT=1TO50:NEXT:NEXT:GOSUB63000:MS$="CUT VOICE3"
1780 GOSUB63100:GOSUB63000:PRINT"[147]"
1790 PRINT"WE'LL COME BACK TO BIT 7 OF SID+24!":GOSUB63000:PRINT"[145][145][145][145]"
1800 PRINT"LET'S TRY SOME OF THIS.":MS$="LET'S TRY!":GOSUB63100:GOSUB63000:XX=0
1900 FQ=7382:WN=65:PU=2048:AT=0:DE=0:SU=15:RE=0:VOL=15:GOSUB63600:GOSUB63000
1910 PRINT"[147]WE HAVE VOICE #1 PLAYING 'A'."
1920 PRINT"NOW WE'LL FILTER IT:":GOSUB63000:POKESID+24,0
1930 PRINT"[147]POKE SID+24,16+15[146]=0001 1111"
1940 PRINT"THIS GIVES VOLUME=15 AND LOW PASS[146]."
1950 PRINT"SINCE 'A'=440 HERTZ WE'LL PICK THE"
1960 PRINT"'CUT OFF FREQUENCY' AT, SAY,2000 HERTZ."
1970 PRINT"WHAT DO WE POKE SID[146] WITH?"
1980 PRINT"2000=30+5.8*(CUTOFF NUMBER) SO"
1990 PRINT"'CUTOFF NUMBER'=(2000-30)/5.8=340"
2000 PRINT"AND 340=0010 1010[146]+100[146](11-BIT BINARY)
2010 [153]"AND 0010 1010WAIT=42 AND 100WAIT=4,SO:"
2020 [153]"POKE SID+21,4:POKESID+22,42":[141]63000
2030 [153]"LOADHAVING SET THE FILTER PARAMETERS, WE"
2040 [153]"SELECT THE VOICE WE WANT FILTERED."
2050 [153]"SID+23 HAS 3 BITS FOR THIS."
2060 [153]NN$(1):[153]NN$(2)"CMDCMDCMDCMDCMDCMD321SID+23":[153]NN$(3)
2070 [153]"POKE SID+23,1WAIT TO FILTER VOICE #1."
2080 [153]"LISTEN..."
2095 [153]"AS WE LOWER THE CUTOFF FREQUENCY"
2096 [153]"THE HIGHER FREQUENCIES ARE"
2097 [153]"ATTENUATED AND THE TONE BECOMES"
2098 [153]"QUIETER AND MORE 'MELLOW'.":[141]63000:FI[178]16:FI$[178]"LOW PASS"
2100 [153]"LOAD "FI$" FILTER ":CF[178]2100:FR[178]440:SID[178]54272:[151]SID[170]21,0
2101 [151]SID[170]24,15:[153]"WITHOUT":[141]63000
2102 [153]"LOAD "FI$" FILTER ":[137]2120
2105 [153]""BL$:[153]"CUT OFF FREQUENCY= CMDCMDCMDCMDCMD"CF"HERTZ"
2106 [153]"CUT OFF NUMBER = CMDCMDCMDCMDCMD"CN%
2107 [153]"POKE SID+21, CMDCMDCMD"LO%":POKE SID+22, CMDCMDCMD"HI%
2110 [153]"VOICE #1 FREQUENCY="FR"HERTZ":[151]SID[170]23,1
2120 CN%[178](CF[171]30)[173]5.8:HI%[178]CN%[173]8:LO%[178]CN%[171]8[172]HI%
2130 [151]SID[170]21,LO%:[151]SID[170]22,HI%:[151]SID[170]24,FI[170]15:[151]SID[170]23,1
2140 [139]XX[178]0[167][139][194](203)[178]64[167]2140
2150 CF[178]CF[171]100:[139]CF[177]0[167]2105
2155 [139]XX[178]1[167]2200
2156 [139]XX[178]2[167] [141]63000:[137]2240
2160 [141]63000:[153]"LOADNOW LET'S TRY THAT WITH"
2170 [153]"A TRIANGLEWAIT WAVEFORM."
2180 [153]"WE POKE SID+4,17WAIT FOR "TR$TR$:[141]63000:XX[178]1:WN[178]17:[141]63600
2190 [141]63000:[137]2100
2200 [141]63000:[153]"LOADNOW LET'S TRY THAT WITH"
2210 [153]"A SAWTOOTHWAIT WAVEFORM."
2220 [153]"WE POKE SID+4,33WAIT FOR "SA$SA$:[141]63000:XX[178]2:WN[178]33:[141]63600
2230 [141]63000:[137]2100
2240 [151]SID[170]21,8:[151]SID[170]22,50:[129]II[178]1[164]5
2241 [153]"LOADFREQUENCY 440 HERTZWAIT "SA$SA$
2242 [153]"CUTOFF AT 1000 HERTZWAIT"
2243 [153]"JUST 2 OR 3 HARMONICS GET THRU' FILTER.."
2244 [153]"WITHCMDCMDCMDCMDFREFREFREFREON FILTERING...":[151]SID[170]23,1:[151]SID[170]24,31
2245 [129]T[178]1[164]500:[130]
2250 [153]"WITHOUTCMDCMDCMDCMDCMDCMDCMDFREFREFREFREFREFREFREON FILTERING...":[151]SID[170]23,0
2255 [129]T[178]1[164]500:[130]:[130]:[151]SID[170]4,65:[151]SID[170]3,150:[129]II[178]1[164]3
2260 [153]"LOADFREQUENCY 440 HERTZWAIT "PU$PU$
2270 [153]"CUTOFF AT 1000 HERTZWAIT"
2280 [153]"JUST 2 OR 3 HARMONICS GET THRU' FILTER.."
2290 [153]"WITHCMDCMDCMDCMDFREFREFREFREON FILTERING...":[151]SID[170]23,1:[151]SID[170]24,31
2300 [129]T[178]1[164]500:[130]
2310 [153]"WITHOUTCMDCMDCMDCMDCMDCMDCMDFREFREFREFREFREFREFREON FILTERING...":[151]SID[170]23,0
2320 [129]T[178]1[164]500:[130]:[130]
2330 [151]SID[170]4,65:[151]SID[170]3,150:[151]SID[170]21,2:[151]SID[170]22,21:[129]II[178]1[164]3
2340 [153]"LOAD HIGH PASS FILTER ":[153]"FREQUENCY 440 HERTZWAIT "PU$PU$
2350 [153]"CUTOFF AT 1000 HERTZWAIT"
2360 [153]"...THE HIGHWAIT HARMONICS GET THRU' FILTER.."
2370 [153]"WITHCMDCMDCMDCMDFREFREFREFREON FILTERING...":[151]SID[170]23,1:[151]SID[170]24,64[170]15
2380 [129]T[178]1[164]500:[130]
2390 [153]"WITHOUTCMDCMDCMDCMDCMDCMDCMDFREFREFREFREFREFREFREON FILTERING...":[151]SID[170]23,0
2400 [129]T[178]1[164]500:[130]:[130]:[151]SID[170]24,0:[141]63000
2410 [151]SID[170]24,15[170]64:[151]SID[170]23,1:[151]SID[170]4,33
2420 [153]"LOAD HIGH PASS FILTER ":[153]"440 HERTZ TONE:"SA$SA$
2425 [129]II[178]10[164]250[169]10:[151]SID[170]22,II
2430 [153]""BL$"POKE SID,"II
2435 [153]"CUTOFF FREQUENCY="[181](II[172]5.8[170]30)
2440 [139][194](203)[178]64[167]2440
2450 [130]:[151]SID[170]24,0:[141]63000
2460 [153]"LOADWITHOUT LOW PASS FILTER WAIT "SA$SA$:SID[178]54272:[151]SID[170]23,0
2480 [153]" JESU JOY ":MS$[178]" TWANGY":[141]63100
2490 VOL[178]10:AT[178]0:DE[178]0:SU[178]10:RE[178]5:M0[178]1:M1[178]31:MV[178]0:WN[178]33:XX[178]2:YY[178]0:[141]10000
2500 [153]"LOAD LOW PASS FILTER WAIT "SA$SA$:SID[178]54272:[151]SID[170]23,1
2510 [153]" CUTOFF FREQUENCY = 2000 HERTZ":[151]SID[170]21,4:[151]SID[170]22,42
2520 [153]" JESU JOY ":MS$[178]" SMOOTH!":[141]63100
2530 VOL[178]15:AT[178]0:DE[178]0:SU[178]10:RE[178]5:M0[178]1:M1[178]31:MV[178]0:WN[178]33:XX[178]2:YY[178]16:[141]10000
2540 [153]"LOAD LOW PASS FILTER WAIT "SA$SA$:SID[178]54272:[151]SID[170]23,7
2550 [153]" CUTOFF FREQUENCY = 2000 HERTZ":[151]SID[170]21,4:[151]SID[170]22,42
2560 [153]" THREE VOICES..PLAYING "
2565 [153]" SUCCESSIVE NOTES." "
2570 PRINT" JESU JOY ":MS$=" FIND #1":GOSUB63100
2580 VOL=10:AT=0:DE=0:SU=10:RE=5:M0=1:M1=31:MV=2:WN=33:XX=2:YY=16:GOSUB10000
2590 GOSUB63000:POKESID+24,0:POKESID+23,0
2600 PRINT"[147] BELLS "
2610 PRINT"POKE SID+1,10 [146] FREQ FOR VOICE #1"
2620 PRINT"POKE SID+7*2+1,9 [146] FREQ FOR VOICE #3"
2630 PRINT"POKE SID+6,10*16+9[146] SUS=10 REL=9"
2640 PRINT"POKE SID+24,15 [146] MAXIMUM VOLUME"
2650 PRINT"FOR I=1 TO 10 [146] 10 TIMES"
2660 PRINT"POKE SID+4,17 [146] GATE VOICE #1"
2670 PRINT"FOR T=1TO500:NEXT[146] DELAY"
2680 PRINT"POKE SID+4,16 [146] TURN OFF #1 "
2690 PRINT"FOR T=1TO500:NEXT[146] DELAY"
2695 PRINT"NEXT I [146]"
2700 SU=10:RE=9:YY=0:ZZ=0:GOSUB12000:GOSUB63000
2710 PRINT"POKE SID+7*2+1,9 [146] FREQ FOR VOICE #3"
2720 PRINT"WE DIDN'T USE VOICE #3!"
2730 PRINT"NOW WE'LL SET BIT 2[146]"
2740 PRINT"OF SID+4":MS$=" SID+4??":GOSUB63100:GOSUB63000
2750 PRINT"POKE SID+4,17+4 [146] WAVE + BIT 2[146] "
2800 SU=10:RE=9:YY=128:ZZ=4:GOSUB12000:GOSUB63000
2900 PRINT"[147]"NN$(1):PRINTNN$(2)" SID+4":PRINTNN$(3)
2910 WV$="[214][214][214][214]":DN$=""
2920 PRINTDN$BL$DN$"WAVEFORM BITS=16,32,64,128"
2930 FORI=1TO6:PRINT""WV$:FORT=1TO50:NEXT:PRINTWV$:FORT=1TO50:NEXT:NEXT
2940 GOSUB63000:PRINTDN$BL$DN$"RING MODULATION BIT"
2950 W1$=WV$+"[214]":W2$=WV$+""+"[214]"
2960 FORI=1TO6:PRINTW1$:FORT=1TO50:NEXT:PRINTW2$:FORT=1TO50:NEXT:NEXT
2970 PRINT"THIS BIT 2[146], WHEN SET=1, CAUSES"
2980 PRINT"VOICE #1 TO BE MODULATED[146] BY VOICE #3."
2990 PRINT"THE SOUND OUTPUT IS THE LOGICAL AND[146]"
3000 PRINT"OF VOICES 1 & 3, GIVING A 'WAVERING'"
3010 PRINT"SOUND...":GOSUB63000:GOSUB12000:MS$=" GONGS":GOSUB63100
3020 PRINT"[147]IF VOICE #3 IS TO 'INFLUENCE' VOICE #1"
3030 PRINT"THEN WE DON'T WANT TO HEAR VOICE #3."
3040 PRINT"IT WOULD BE CONVENIENT IF WE COULD"
3050 PRINT"CUT VOICE #3":GOSUB63000:PRINT"[147]"NN$(1)
3055 PRINTNN$(2)" SID+24":PRINTNN$(3)
3060 LP$=""
3070 BP$=""
3080 HP$=""
3090 DN$=""
4000 PRINTDN$BL$DN$"LOW PASS BIT":FORI=1TO5:PRINTLP$"[214]":FORT=1TO50:NEXT
4010 PRINTLP$"[214][146]":FORT=1TO50:NEXT:NEXT:GOSUB63000
4020 PRINTDN$BL$DN$"BAND PASS BIT":FORI=1TO5:PRINTBP$"[214]":FORT=1TO50:NEXT
4030 PRINTBP$"[214][146]":FORT=1TO50:NEXT:NEXT:GOSUB63000
4040 PRINTDN$BL$DN$"HIGH PASS BIT":FORI=1TO5:PRINTHP$"[214]":FORT=1TO50:NEXT
4050 PRINTHP$"[214][146]":FORT=1TO50:NEXT:NEXT:GOSUB63000
4060 PRINTDN$BL$DN$"VOLUME CONTROL!":FORI=1TO5
4065 PRINTLP$"[214][214][214][214]":FORT=1TO50:NEXT
4070 PRINTLP$"[214][214][214][214]":FORT=1TO50:NEXT:NEXT:GOSUB63000
4080 PRINTDN$BL$DN$"..AND THIS BIT?":FORI=1TO5:PRINTHP$"[157][157]?":FORT=1TO50:NEXT
4090 PRINTHP$"[157][157]?[146]":FORT=1TO50:NEXT:NEXT:GOSUB63000:MS$="CUT VOICE3"
4100 GOSUB63100:GOSUB63000
9998 POKE54272+24,0
9999 GOSUB63000:PRINT"[147]":MS$="AU REVOIR!":GOSUB63100:PRINT"":END
10000 IFPU=0THENPU=4000
10001 S=54272:FORVV=0TO2:POKES+5+7*VV,16*AT+DE:POKES+6+7*VV,16*SU+RE
10002 POKES+2+7*VV,PUAND255:POKES+3+7*VV,PU/256:POKES+7*VV,0:POKES+1+7*VV,0
10003 NEXT:POKES+24,VOL+YY:QQ=2^(1/12)
10004 IFXX=2THEN10010
10005 PRINT""BL$:PRINTBL$:PRINT"[145][145]"
10006 IFWN=17THENPRINT" "TR$TR$TR$TR$
10007 IFWN=33THENPRINT" "SA$SA$SA$SA$
10008 IFWN=65THENPRINT" "PU$PU$PU$PU$
10009 IFWN=129THENPRINT" "NO$
10010 FORI=M0TOM1:FR=2000*(QQ^N(I))
10020 HI=INT(FR/256):LO=FR-256*HI:POKES+7*VC,LO:POKES+1+7*VC,HI:POKES+4+7*VC,WN
10030 FORJ=1TO50*P(I):NEXT:VC=VC+1:IFVC>MVTHENVC=0
10035 POKES+4+7*VC,WN-1
10040 NEXT:FORVV=0TO2:POKES+4+7*VV,0:NEXT:FORT=1TO500:NEXT:IFXX=0THENGOSUB63000
10050 RETURN
11000 PRINTNN$(1):PRINTNN$(2)M$:PRINTNN$(3):RETURN
11100 PRINTR$"";M$"[145]":PRINT:IFXX=0THEN RETURN
11110 FORT=1TO300:NEXT:RETURN
12000 POKESID+1,10:POKESID+15,9:POKESID+24,15+YY:POKESID+6,SU*16+RE
12010 FORI=1TO5:POKESID+4,17+ZZ:FORT=1TO100:NEXT:POKESID+4,16+ZZ
12020 FORT=1TO1000:NEXT:NEXT:RETURN
50000 REM JESU JOY
50001 RESTORE
50002 READ M
50003 DIM N(M),P(M)
50005 FORI=1TOM
50006 READN(I),P(I):NEXT:RETURN
50009 DATA 103
50010 DATA12,2,8,2,10,2,12,2,15,2,13,2,13,2,17,2,15,2,15,2
50011 DATA20,2,19,2,20,2,15,2,12,2,8,2,10,2,12,2,13,2,15,2
50012 DATA17,2,15,2,13,2,12,2,10,2,12,2,8,2,7,2,8,2,10,2
50013 DATA3,2,7,2,10,2,13,2,12,2,10,2,12,2,8,2,10,2,12,2
50014 DATA15,2,13,2,13,2,17,2,15,2,15,2,20,2,19,2,20,2,15,2
50015 DATA12,2,8,2,10,2,12,2,5,2,15,2,13,2,12,2,10,2,8,2
50016 DATA3,2,8,2,7,2,8,2,12,2,15,2,20,2,15,2,12,2,8,2
50017 DATA12,2,15,2,18,2,15,2,12,2,8,2,12,2,15,2,17,2,13,2
50018 DATA10,2,7,2,10,2,13,2,15,2,12,2,8,2,5,2,8,2,12,2
50019 DATA13,2,10,2,7,2,3,2,7,2,10,2,13,2,12,2,10,2,8,2
50020 DATA12,2,15,2,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
60000 REM INITIALIZE
60001 BT$="":FORI=1TO24:BT$=BT$+"":NEXT
60002 PT$="[176][192][192][192][192][192][192][192][192][192][192][174][157][157][157][157][157][157][157][157][157][157][157][157][221][221][157][157][157][157][157][157][157][157][157][157][157][157][173][178][192][192][192][192][192][192][192][192][178][189]"
60003 PT$=PT$+"[157][157][157][157][157][157][157][157][157][157][157][157][157][206][163][163][163][163][163][163][163][163][163][163][163][163][205][157][157][157][157][157][157][157][157][157][157][157][157][157][157][165]============[167]"
60004 PT$=PT$+"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][208][207][163][163][163][163][163][163][163][163][163][163][208][207][145][145][145][145][157][157][157][157][157][157][157][157][157][157][157][157]"
60005 PT$=BT$+"[145][145][145][145][145][145]"+PT$+"[144]"
60007 BL$=" "
60008 WD=40:CRT=1024
60009 POKE53281,1:POKE53280,15:PRINT"[144]"
60012 N$(1)="[176][192][178][192][178][192][178][192][174]"
60013 N$(2)="[221] [221] [221] [221] [221]"
60014 N$(3)="[173][192][177][192][177][192][177][192][189]"
60015 NN$(1)="[176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174]"
60016 NN$(2)="[221] [221] [221] [221] [221] [221] [221] [221] [221]"
60017 NN$(3)="[173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
60020 R$="[176][178][178][178][178][178][178][178][174][157][157][157][157][157][157][157][157][157][173][177][177][177][177][177][177][177][189][145]"
60030 L$="- - - - - - - - -"
60040 PS$=""
60050 DN$=""
60060 BMM$="":MCM$="":SMB$=""
60070 CMB$=SMB$+"":CL$=" "
60080 DN$=DN$+CL$+DN$
60090 SC$=SMB$+""
60100 CH$=SC$+""
60110 DD$="":DD$=DD$+CL$+DD$
60120 TR$="[206][145][206][205][205]"
60130 SA$="[206][145][206][165][157][204]"
60140 PU$="[165][145][157][207][208][157][167][164][164][164][164][157]":NN=9
60150 SID=54272:FORI=0TO28:POKESID+I,0:NEXT
60200 GOSUB62005:GOSUB63500:RETURN
62000 :
62005 U$="[180][145][157]":D$="[180][157]":T$="[207][180][157]":B$="[204][180][145][157]"
62010 A$(0)="[175]"
62011 A$(1)=T$+B$:U=1:D=2:FORJ=2TO10
62012 A$="":FORI=1TOU:A$=A$+U$:NEXT:A$=A$+T$:FORI=1TOD:A$=A$+D$:NEXT
62013 A$=A$+B$:FORI=1TOU:A$=A$+U$:NEXT:A$(J)=A$:U=U+1:D=2*U:NEXT
62015 FORJ=1TO5:D$(J)=A$(10-J):NEXT
62016 SS$=D$(5)
62017 FORI=1TO5:R$(I)=A$(5-I):NEXT
62020 RETURN
63000 PRINT"HIT RETURN[146] TO CONTINUE";
63001 GETA$:IFA$<>""THEN63001
63002 GETA$:IFA$=""THEN63002
63003 RETURN
63004 RETURN
63100 FORT=1TO5:PRINTPT$MS$;
63101 PRINTPT$" ";
63102 PRINTPT$MS$;:NEXT
63103 PRINT"[144]":RETURN
63200 PRINT"":FORI=0TO10:FORJ=1TOLEN(A$(I))
63205 PRINTMID$(A$(I),J,1);:NEXT:NEXT
63210 FORI=0TO5:FORJ=1TOLEN(D$(I))
63215 PRINTMID$(D$(I),J,1);:NEXT:NEXT
63220 FORI=0TO3:FORJ=1TOLEN(SS$)
63225 PRINTMID$(SS$,J,1);:NEXT:NEXT
63230 RETURN
63300 PRINT""
63305 FORI=0TO10:FORJ=1TOLEN(SS$)
63310 PRINTMID$(SS$,J,1);:NEXT:NEXT
63320 FORI=0TO4:FORJ=1TOLEN(R$(I))
63330 PRINTMID$(R$(I),J,1);:NEXT:NEXT
63340 FORI=1TO3:PRINTA$(0);:NEXT:RETURN
63400 PRINT"":FORI=3TO10:PRINTA$(I);:NEXT
63410 FORI=1TO5:PRINTD$(I);:NEXT
63420 FORI=0TO2:PRINTSS$;:NEXT
63430 FORI=1TO4:PRINTR$(I);:NEXT
63450 PRINT"-----A[146]TTACK------D[146]ECAY--S[146]USTAIN--R[146]ELEASE":RETURN
63500 U$="[221][145][157]":D$="[221][157]"
63510 A$="":FORI=1TONN:K=1+4*RND(1):FORJ=1TOK:A$=A$+U$:NEXT:A$=A$+"[176][174][157]"
63520 FORJ=1TOK:A$=A$+D$:NEXT:A$=A$+"[145][173]":NEXT:NO$=A$:RETURN
63600 PRINT"[147]SID=54272":SID=54272
63601 POKESID+4,0:POKESID+23,0
63605 IFXX=0THEN GOSUB63000
63610 PRINT"HI=INT("FQ"/256)":HI=INT(FQ/256)
63615 IFXX=0THENGOSUB63000
63620 PRINT"LO="FQ"-256*HI":LO=FQ-256*HI
63625 IFXX=0THENGOSUB63000
63630 PRINT"POKE SID ,LO":POKESID,LO
63635 IFXX=0THENGOSUB63000
63640 PRINT"POKE SID+1,HI":POKESID+1,HI
63645 IFXX=0THENGOSUB63000
63646 IFPU=0THEN63680
63650 PRINT"PULSE="PU
63655 IFXX=0THENGOSUB63000
63660 PRINT"POKE SID+2,PULSE AND 255":POKESID+22,PUAND255
63665 IFXX=0THENGOSUB63000
63670 PRINT"POKE SID+3,PULSE/256":POKESID+3,PU/256
63675 IFXX=0THENGOSUB63000
63680 PRINT"AT="AT":DE="DE":SU="SU":RE="RE
63681 IFXX=0THENGOSUB63000
63685 PRINT"POKE SID+5,16*AT+DE":POKESID+5,16*AT+DE
63686 IFXX=0THENGOSUB63000
63690 PRINT"POKE SID+6,16*SU+RE":POKESID+6,16*SU+RE
63695 IFXX=0THENGOSUB63000
63700 PRINT"VOLUME="VOL
63705 IFXX=0THENGOSUB63000
63710 PRINT"POKE SID+24,VOLUME":POKESID+24,VOL
63715 IFXX=0THENGOSUB63000
63720 PRINT"WN="WN
63725 IFXX=0THENGOSUB63000
63730 PRINT"POKE SID+4,WN :REM GATE IT":POKESID+4,WN
63745 RETURN
63800 PRINT"[147]FREQ (HERTZ)= "FR:INPUT"[145]";FR:IFFR>3900THEN63800
63801 FQ=INT(FR/.059604645+.5):PRINT"FQ="FQ
63805 PRINT"WAVEFORM (T[146]RIANGLE,S[146]AWTOOTH,P[146]ULSE"
63806 GETWN$:IFWN$=""THEN63806
63810 IFWN$="T"THENWN=17:GOTO63825
63815 IFWN$="S"THENWN=33:GOTO63825
63820 IFWN$="P"THENWN=65:GOTO63825
63821 GOTO63806
63825 PRINT"WN="WN:IFWN<>65THEN63835
63830 PRINT"PULSE WIDTH= ";PU
63831 INPUT"[145]";PU
63835 PRINT"ATTACK= ";AT
63836 INPUT"[145]";AT
63837 PRINT"DECAY = ";DE
63838 INPUT"[145]";DE
63840 PRINT"SUSTAIN = ";SU
63841 INPUT"[145]";SU
63842 PRINT"RELEASE = ";RE
63843 INPUT"[145]";RE
63845 INPUT"VOLUME 15[157][157][157][157]";VOL
63850 RETURN